﻿@page "/gwhome/coder"
@inherits AbpToolComponentBase
<PageTitle>@L["Menu:Gwhome:Coder"]</PageTitle>
<DisplayHeading Size="DisplayHeadingSize.Is4">神桥</DisplayHeading>


<Row>

    <Column ColumnSize="ColumnSize.Is9">
        <TextEdit @bind-Text="@_sql" Label="sql语句" />
    </Column>

    <Column ColumnSize="ColumnSize.Is3">
        <MudButton Class="align-self-center" FullWidth="true" Disabled="@_processing" OnClick="ConvertToCharpModel" Variant="Variant.Filled" Color="Color.Primary">
            @if (_processing)
            {
                <MudProgressCircular Class="ms-n1" Indeterminate="true" />
                <MudText Class="ms-2">Processing</MudText>
            }
            else
            {
                <MudText>转换成C#实体</MudText>
            }
        </MudButton>
    </Column>
    <MudItem xs="6">
        <MudCard>
            <MudCardContent>
                <MudText>C#实体</MudText>
                @foreach (var result in _properties)
                {
                    <div>@result</div>
                }

            </MudCardContent>
            <MudCardActions>
                <MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="ClearData">清除历史</MudButton>
            </MudCardActions>
        </MudCard>
    </MudItem>
    <MudItem xs="6">
        <MudCard>
            <MudCardContent>
                <MudText>json解析</MudText>
                @foreach (var result in _parseCode)
                {
                    <div>@result</div>
                }

            </MudCardContent>
            <MudCardActions>
                <MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="ClearData">清除历史</MudButton>
            </MudCardActions>
        </MudCard>
    </MudItem>
    <MudItem xs="12">
        <MudCard>
            <MudCardContent>
                <MudText>MudTable表格</MudText>
                @foreach (var result in _mudTables)
                {
                    @* <MudText Typo="Typo.body2">@result</MudText> *@
                    <div>@result</div>
                }
            </MudCardContent>
            <MudCardActions>
                <MudButton Variant="Variant.Text" Color="Color.Primary" OnClick="ClearData">清除历史</MudButton>
            </MudCardActions>
        </MudCard>
    </MudItem>
</Row>